package me.j360.springboot.jar;

import me.j360.springboot.jar.atomikos.AccountRepository;
import me.j360.springboot.jar.atomikos.AccountService;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;

import java.io.Closeable;

/**
 * Created with springbootweb -> me.j360.springboot.jar.
 * User: min_xu
 * Date: 2015/7/28
 * Time: 15:28
 * 说明：
 */
public class J360Application {
    //public static void main(String[] args) {
    //    SpringApplication.run(J360Configuration.class, args);
    //}


    public static void main(String[] args) throws Exception {
        ApplicationContext context = SpringApplication.run(
                J360Configuration.class, args);

        /*AccountService service = context.getBean(AccountService.class);
        AccountRepository repository = context.getBean(AccountRepository.class);
        //service.createAccountAndNotify("josh");
        //System.out.println("Count is " + repository.count());
        try {
            service.createAccountAndNotify("error");
        }
        catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
        System.out.println("Count is " + repository.count());
        Thread.sleep(100);
        ((Closeable) context).close();*/
    }
}
